﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DCInward.aspx.cs" Inherits="Main_Inventory_DCInward"
    Culture="en-GB" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />

    <script src="../../JavaScript/Commons.js" type="text/javascript"></script>

    <script type="text/javascript">
            function Enable() {
                return true;
            }
            function Desable() {
                return false;
            }
            function EnabledTabKey(id, e) {
                var keycode;
                if (window.event) {
                    keycode = window.event.keyCode;
                }
                else if (e) {
                    keycode = e.which;
                }
                else {
                    return true;
                }

                if (keycode == 9) {
                    // if is the tab key                
                    return true;
                }
                else {
                    return false;
                }
            }
            function GetQuantity(hidItemId, CtrlId, HidLocationId) {
             var ddl=document.getElementById(hidItemId).value;
                if (ddl != '' && parseFloat(ddl) > 0) {
                    var ctrlIndex = HidLocationId.toString();
                    var LocationIdandQty = document.getElementById(ctrlIndex).value;
                    window.open('DCInwardSaleQty.aspx?ItemId=' + ddl + '&CtrlId=' + CtrlId + '&HidLocationId=' + HidLocationId + '&LocationIdandQty=' + LocationIdandQty, '', 'width=700, height=400, resizable=0');
                }
                else {
                    alert('Choose Item First');
                    return false;
                }
            } 
            
            function CalculateAmtBillLevel() {
                var Count = document.getElementById("hcount").value;
                var TotalQty = 0;
                var TotalAmount = 0;
                var TotalTax = 0;
                for (var i = 1; i <= Count; i++) {
                    var Qty = document.getElementById("txtquantity" + i);
                    var RateAmt = document.getElementById("txtrate" + i);
//                    var TaxRate = document.getElementById("hidTaxRate" + i);
//                    var TaxAmount = document.getElementById("hidtaxamt" + i);
                    var ItemAmount = document.getElementById("txtamount" + i);
                    var itemAmt = 0;
                    var taxAmt = 0;
                    if (Qty.value != '' && parseFloat(Qty.value) > 0) {
                        TotalQty += parseFloat(Qty.value);
                        if (RateAmt.value != '' && parseFloat(RateAmt.value) > 0) {
                            itemAmt = parseFloat(Qty.value) * parseFloat(RateAmt.value);
                            //TotalAmount += parseFloat(itemAmt);

//                            if (TaxRate.value != '' && parseFloat(TaxRate.value) > 0) {
//                                taxAmt = (parseFloat(itemAmt) * parseFloat(TaxRate.value)) / 100;
//                            }
//                            TotalTax += parseFloat(taxAmt);
                        }
                        document.getElementById("txtamount" + i).value = parseFloat(itemAmt).toFixed(2);
                        //document.getElementById("hidTaxAmtBillLevel" + i).value = parseFloat(taxAmt).toFixed(2);
                    }
                }
            }
            function ValidateItems() {
                var flag = true;
                if (document.getElementById("ddldcformate").selectedIndex == 0) {
                    alert('Please Select Bill Format ');
                    document.getElementById("ddldcformate").focus();
                    flag = false;
                }
                else if (document.getElementById("ddlSupplier").selectedIndex == 0) {
                    alert('Please Select Supplier ');
                    document.getElementById("ddlSupplier").focus();
                    flag = false;
                }
                else if (document.getElementById("txtVoucher").value == '' || document.getElementById("txtVoucher").value == 'Number') {
                    alert('Please Specify Voucher Number');
                    document.getElementById("txtVoucher").focus();
                    flag = false;
                }
                else if (document.getElementById("ddltaxgroup").selectedIndex == 0) {
                    alert('Please Select Tax Group ');
                    document.getElementById("ddltaxgroup").focus();
                    flag = false;
                }
                else if (document.getElementById("txtDate").value == '' || document.getElementById("txtDate").value == '__/__/____') {
                    alert('Please Specify  Date');
                    document.getElementById("txtDate").focus();
                    flag = false;
                }
                else if (document.getElementById("ddlItems1").selectedIndex == 0) {
                    alert('Please Select At Least One Item ');
                    document.getElementById("ddlItems1").focus();
                    flag = false;
                }
                else if (document.getElementById("txtquantity1").value == '') {
                    alert('Please Specify Quantity For First Item');
                    document.getElementById("txtquantity1").focus();
                    flag = false;
                }
                else if (document.getElementById("txtrate1").value == '') {
                    alert('Please Specify Rate Inclusive Tax');
                    document.getElementById("txtrate1").focus();
                    flag = false;
                }
                else if (document.getElementById("hidCheckDelivery").value == 'True') {
                    if (document.getElementById("txtdeliverydate").value == '' || document.getElementById("txtdeliverydate").value == '__/__/____') {
                        alert('Please Specify Delivery Date');
                        document.getElementById("txtdeliverydate").focus();
                        flag = false;
                    }
                }
                return flag;
            }
            function ValidateItems1() {
                var flag = true;
                var Count = document.getElementById("hcount").value;
                for (var i = 2; i <= Count; i++) {
                    if (document.getElementById("ddlItems" + i).selectedIndex != 0) {
                        if (document.getElementById("txtquantity" + i).value == '') {
                            alert('Please Specify Quantity at Row No ' + ' ' + i);
                            document.getElementById("txtquantity" + i).focus();
                            flag = false;
                        }
                        if (document.getElementById("txtrate" + i).value == '') {
                            alert('Please Specify Rate Inclusive Tax at Row No ' + ' ' + i);
                            document.getElementById("txtrate" + i).focus();
                            flag = false;
                        }
                    }
                    else if (document.getElementById("txtquantity" + i).value != '') {
                        if (document.getElementById("ddlItems" + i).selectedIndex == 0) {
                            alert('Please Specify Item in Row No ' + ' ' + i);
                            document.getElementById("ddlItems" + i).focus();
                            flag = false;
                        }
                        if (document.getElementById("txtrate" + i).value == '') {
                            alert('Please Specify Rate Inclusive Tax at Row No ' + ' ' + i);
                            document.getElementById("txtrate" + i).focus();
                            flag = false;
                        }
                    }
                    else if (document.getElementById("txtrate" + i).value != '') {
                        if (document.getElementById("txtquantity" + i).value == '') {
                            alert('Please Specify Quantity in Row No ' + ' ' + i);
                            document.getElementById("txtquantity" + i).focus();
                            flag = false;
                        }
                        else if (document.getElementById("ddlItems" + i).selectedIndex == 0) {
                            alert('Please Specify Item in Row No ' + ' ' + i);
                            document.getElementById("ddlItems" + i).focus();
                            flag = false;
                        }
                    }
                    
                }
                return flag;
            }

            function ValidationInput() {
                if (ValidateItems() == true && ValidateItems1() == true) {
                    return true;
                }
                else {
                    return false;
                }
            }

            function checkItemRepetion(id) {
              var flag=true;
                var ddl = document.getElementById(id);
                var unitno=id.toString().substring(8);
                var currentValue = ddl.options[ddl.selectedIndex].value;
                var Count = document.getElementById("hcount").value;
                for (var i = 1; i <= Count; i++) {
                    var previous = document.getElementById("ddlItems" + i);
                    var previousValue = previous.options[previous.selectedIndex].value;
                    if(ddl.value=='0')
                    {
                      document.getElementById("txtunit"+unitno).value='';
                      document.getElementById("txtquantity"+unitno).value='';
                      document.getElementById("hidLocationBillLevel"+unitno).value='';
                      document.getElementById("txtrate"+unitno).value='';
                      document.getElementById("txtamount"+unitno).value='';
                      flag=false;
                    }
                    else if (ddl != previous) {
                        if (currentValue == previousValue) {
                            alert('Please Select Unique Item');
                            ddl.selectedIndex = 0;
                            flag=false;
                            break;
                        }
                    }
                }
               if(flag==true)
               {
                 setTimeout('__doPostBack(\''+ddl+'\',\'\')', 0);
               }
                return flag;
            }
//            function Open_DCInward_Details(poid, transferedid, supplier, taxgroup, trnid) {
//                //window.open("Purchase_Recive_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", 'PurchaseInvoice', 'width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
//                window.open("DCInward_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", "");
            //            }
                                            //TFOID,VendCust_Lid,TRNID,FINYEAR
            function Open_DCInward_Details(formateid, supplierid, trnid, finyear) {
                //window.open("Purchase_Recive_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", 'PurchaseInvoice', 'width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
                //window.open("DCInward_Details.aspx?TFOID=" + formateid + "&VendCust_Lid=" + supplierid + "&TRNID=" + trnid + "&FINYEAR=" + finyear + "");
                window.open("InventoryPrint/DcInward_Print.aspx?TFOID=" + formateid + "&VendCust_Lid=" + supplierid + "&TRNID=" + trnid + "&FINYEAR=" + finyear + "");
            }
            function open_DCIward_DeliveryAdd(txtdeliveryadd){
               if((document.getElementById("ddlsupplier").value)!="0")
                 {
                   var supp_id=document.getElementById("ddlsupplier").value;
                   window.open("DCInward_DeliveryAdd.aspx?returnTextbox="+txtdeliveryadd+"&suppid="+supp_id+"",'');
                   return false;
                 }
                 else
                 {
                   alert("Please Select Supplier First !");
                   document.getElementById("ddlsupplier").focus();
                    return false;
                 }
            }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    <center>
                        <img src="../../Images/ajax-loader.gif" alt="Loading...." /></center>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <div class="divmain" style="width: 95%; margin-left: 3%;">
                <acc:heading ID="pagehead" runat="server" HeadingText="DC Inward" />              
            </div>
             <div style="margin-left: 10%; margin-right: 3%; width: 85%" align="center">
                    <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
             </div>
       <asp:Panel ID="PnlAddNew" runat="server" Visible="false">

            <div style="width: 98%; margin-left: 3%;">
                <asp:HiddenField ID="hidCheckDelivery" runat="server" Value="True" />
                <table class="tablecontent" style="width: 110%">
                    <tr>
                        <td colspan="2" style="width: 100%;" class="headtd">
                            DC Inward
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 40%; height: 20%;">
                            <table class="tablecontent" style="width: 100%; margin-top: 2px;">
                                <tr>
                                    <td>
                                        DC Format <span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddldcformate" runat="server" OnSelectedIndexChanged="ddldcformate_SelectedIndexChanged"
                                            AutoPostBack="true" CssClass="dropdown">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        DC No.<span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPrefix" runat="server" Width="60px" CssClass="input" onKeyPress="return false"
                                            onKeydown="return false"></asp:TextBox>
                                        <ajaxcontrol:textboxwatermarkextender id="prefixWater" runat="server" targetcontrolid="txtPrefix"
                                            watermarktext="Prefix" watermarkcssclass="watermark_textbox"></ajaxcontrol:textboxwatermarkextender>
                                        <asp:TextBox ID="txtVoucher" runat="server" Width="60px" CssClass="inputnumber" ValidationGroup="V"
                                            MaxLength="10"></asp:TextBox>
                                        <ajaxcontrol:textboxwatermarkextender id="voucherWater" runat="server" targetcontrolid="txtVoucher"
                                            watermarktext="Number" watermarkcssclass="watermark_textbox"></ajaxcontrol:textboxwatermarkextender>
                                        <asp:TextBox ID="txtSuffix" runat="server" Width="60px" CssClass="input" onKeyPress="return false"
                                            onKeydown="return false"></asp:TextBox>
                                        <ajaxcontrol:textboxwatermarkextender id="suffixWater" runat="server" targetcontrolid="txtSuffix"
                                            watermarktext="Suffix" watermarkcssclass="watermark_textbox"></ajaxcontrol:textboxwatermarkextender>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Date <span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtdate" runat="server" CssClass="input"></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator ID="reqDate" runat="server" ControlToValidate="txtDate" ValidationGroup="V" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>--%>&nbsp;
                                        <asp:ImageButton ID="btnDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                                        <ajaxcontrol:calendarextender id="cal" runat="server" popupbuttonid="btnDate" targetcontrolid="txtdate"
                                            format="dd/MM/yyyy"></ajaxcontrol:calendarextender>
                                        <ajaxcontrol:maskededitextender id="maskExt" runat="server" masktype="Date" mask="99/99/9999"
                                            targetcontrolid="txtdate" culturename="pt-BR"></ajaxcontrol:maskededitextender>
                                        <ajaxcontrol:maskededitvalidator id="maskValid" runat="server" controlextender="maskExt"
                                            invalidvaluemessage="Invalid Date" isvalidempty="true" display="Dynamic" validationgroup="V"
                                            controltovalidate="txtdate"></ajaxcontrol:maskededitvalidator>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 60%; height: 20%;">
                            <table class="tablecontent" style="width: 100%;">
                                <tr>
                                    <td>
                                        Supplier <span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlsupplier" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlsupplier_SelectedIndexChanged"
                                            CssClass="dropdown">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="left" style="width: 15px;">
                                    </td>
                                    <td valign="top" align="left">
                                        <asp:TextBox ID="txtdeliveryadd" runat="server" TextMode="MultiLine" CssClass="input"></asp:TextBox>
                                        <asp:HiddenField ID="hiddelivery_id" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tax Group <span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddltaxgroup" runat="server" CssClass="dropdown">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="center" colspan="3">
                                        <asp:Button ID="btndeliveryadd" runat="server" CssClass="button" Text=" Delivery Add "
                                            OnClientClick="return open_DCIward_DeliveryAdd('txtdeliveryadd');" CausesValidation="False">
                                        </asp:Button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Category <span style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlcategory" runat="server" Enabled="false" CssClass="dropdown">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100%;" colspan="2">
                            <table class="tablecontent" style="width: 100%; border: 1px solid #818181; margin-top: 10px;
                                margin-bottom: 10px;">
                                <tr>
                                    <td style="width: 100%;">
                                        <asp:HiddenField ID="hcount" Value="2" runat="server" />
                                        <table id="tblitem" runat="server" class="tablecontent" style="width: 98%; margin: 3px;">
                                            <tr>
                                                <td style="width: 10%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                                    text-align: center; font-weight: bold" class="headtd">
                                                    <b>Item (s)</b>
                                                </td>
                                                <td style="width: 10%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                                    text-align: center; font-weight: bold" class="headtd">
                                                    <b>Unit</b>
                                                </td>
                                                <td style="width: 13%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                                    text-align: center; font-weight: bold" class="headtd">
                                                    <b>Quantity</b>
                                                </td>
                                                <td style="width: 10%; border-right: 1px solid #818181; border-bottom: 1px solid #818181;
                                                    text-align: center; font-weight: bold" class="headtd">
                                                    <b>Rate</b>
                                                </td>
                                                <td style="width: 10%; border-bottom: 1px solid #818181; text-align: center; font-weight: bold"
                                                    class="headtd">
                                                    <b>Amount</b>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center">
                                                    <asp:DropDownList ID="ddlitems1" runat="server" CssClass="dropdown" onchange="return checkItemRepetion(this.id);"
                                                        OnSelectedIndexChanged="ddlitems_OnSelectedIndexChanged" Width="95%" AutoPostBack="true">
                                                    </asp:DropDownList>
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtunit1" runat="server" CssClass="input" Style="width: 95%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField
                                                        ID="huomid1" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtquantity1" runat="server" CssClass="inputnumber" Style="width: 88%;"
                                                        OnKeyDown="return EnabledTabKey(this.ID,event);" Width="80%" />&nbsp;<asp:Button
                                                            ID="btnQtyBillLevel1" runat="server" Text="..." Width="5%" CssClass="button" /><asp:HiddenField
                                                                ID="hidLocationBillLevel1" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtrate1" runat="server" CssClass="inputnumber" Style="width: 95%;"
                                                        OnKeyPress="return isNumberKey(this.ID,event);" onBlur="return CalculateAmtBillLevel();" /><asp:HiddenField
                                                            ID="hidTaxRate1" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtamount1" runat="server" CssClass="inputnumber" Style="width: 95%;"
                                                        OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="hidtaxamt1"
                                                            runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center">
                                                    <asp:DropDownList ID="ddlitems2" runat="server" CssClass="dropdown" OnSelectedIndexChanged="ddlitems_OnSelectedIndexChanged"
                                                        Width="95%" onchange="return checkItemRepetion(this.id);" AutoPostBack="true">
                                                    </asp:DropDownList>
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtunit2" CssClass="input" runat="server" Style="width: 95%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField
                                                        ID="huomid2" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtquantity2" runat="server" CssClass="inputnumber" Style="width: 88%;"
                                                        OnKeyDown="return EnabledTabKey(this.ID,event);" Width="80%" />&nbsp;<asp:Button
                                                            ID="btnQtyBillLevel2" runat="server" Text="..." Width="5%" CssClass="button" /><asp:HiddenField
                                                                ID="hidLocationBillLevel2" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtrate2" runat="server" CssClass="inputnumber" Style="width: 95%;"
                                                        OnKeyPress="return isNumberKey(this.ID,event);" onBlur="return CalculateAmtBillLevel();" /><asp:HiddenField
                                                            ID="hidTaxRate2" runat="server" />
                                                </td>
                                                <td align="center">
                                                    <asp:TextBox ID="txtamount2" runat="server" CssClass="inputnumber" Style="width: 95%;"
                                                        OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="hidtaxamt2"
                                                            runat="server" />
                                                </td>
                                            </tr>
                                        </table>
                                        <table style="width: 90%; margin-top: 5px;" align="right">
                                            <tr>
                                                <td>
                                                    <asp:LinkButton ID="btnAddMore" runat="server" OnClick="btnAddMore_Click"> 
                                        <img src="../../Images/More.jpg" alt="Add New Row" />
                                                    </asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <table style="width: 100%;" class="tablecontent" id="divdeliverydetails" runat="server">
                                <tr>
                                    <td class="headtd" style="width: 100%;" colspan="4">
                                        <b>Delivery Details</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Mode Of Delivery
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtmodeofdelivery" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                    <td>
                                        Freight Indicator
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtfreightindicator" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Transporter Name
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txttransportername" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                    <td>
                                        Document No.
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtdocumentno" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Delivery Date <span id="spanRequireDate" runat="server" style="color: Red">*</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtdeliverydate" runat="server" CssClass="input"></asp:TextBox>
                                        <asp:ImageButton ID="btnimage" runat="server" ImageUrl="~/Images/calendar.gif" />
                                        <ajaxcontrol:calendarextender id="CalendarExtender1" runat="server" popupbuttonid="btnimage"
                                            targetcontrolid="txtdeliverydate" format="dd/MM/yyyy"></ajaxcontrol:calendarextender>
                                        <ajaxcontrol:maskededitextender id="MaskedEditExtender1" runat="server" masktype="Date"
                                            mask="99/99/9999" targetcontrolid="txtdeliverydate" culturename="pt-BR"></ajaxcontrol:maskededitextender>
                                        <ajaxcontrol:maskededitvalidator id="MaskedEditValidator1" runat="server" controlextender="maskExt"
                                            invalidvaluemessage="Invalid Date" isvalidempty="true" display="Dynamic" validationgroup="V"
                                            controltovalidate="txtdeliverydate"></ajaxcontrol:maskededitvalidator>
                                    </td>
                                    <td>
                                        Vehicle No
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtvehicleno" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            <table style="width: 100%; margin-top: 10px;" class="tablecontent">
                                <tr>
                                    <td class="headtd" style="width: 100%;" colspan="4">
                                        <b>Other Details</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdpreparedby" runat="server">
                                        Prepared By
                                    </td>
                                    <td id="tdpreparedbyvlaue" runat="server">
                                        <asp:TextBox ID="txtpreparedby" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                    <td id="tdcheckedby" runat="server">
                                        Checked By
                                    </td>
                                    <td id="tdcheckedbyvalue" runat="server">
                                        <asp:TextBox ID="txtcheckedby" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdauthorisedby" runat="server">
                                        Authorised Signature
                                    </td>
                                    <td id="tdauthorisedbyvalue" runat="server">
                                        <asp:TextBox ID="txtauthorisedsignature" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                    <td id="tdnote" runat="server">
                                        Note
                                    </td>
                                    <td id="tdnotevalue" runat="server">
                                        <asp:TextBox ID="txtnote" runat="server" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdremarks" runat="server">
                                        Remarks
                                    </td>
                                    <td colspan="3" id="tdremarksvalue" runat="server">
                                        <asp:TextBox ID="txtremarks" runat="server" Style="width: 83%;" CssClass="input"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table style="width: 90%;">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnSave" Text="Save" runat="server" CssClass="button" ValidationGroup="V"
                                OnClientClick="return ValidationInput();" OnClick="btnSave_Click" />
                            &nbsp;
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="button" OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </div>
       </asp:Panel>
       <asp:Panel ID="PnlView" runat="server" Visible="false">
            <div style="width: 98%; margin-left: 3%; margin-top: 2px;">
                <table style="width: 100%;">
                    <tr>
                        <td style="width: 100%;">
                            <asp:GridView ID="grdview" runat="server" Width="95%" AllowPaging="true" CssClass="gridview"
                                AlternatingRowStyle-CssClass="gridview_alternate" OnRowDataBound="grdview_RowDataBound"
                                DataKeyNames="TFOID,VendCust_Lid,TRNID,FINYEAR" AutoGenerateColumns="false"
                                 OnPageIndexChanging="grdview_PageIndexChanging">
                                <Columns>
                                    <asp:TemplateField HeaderText="S.No.">
                                        <ItemTemplate>
                                            <%#Container.DataItemIndex+1 %>
                                            <%--<asp:Label ID="lbldcfomate" runat="server" Text='<%#Eval("") %>'></asp:Label>--%>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="DC Format">
                                        <ItemTemplate>
                                            <asp:Label ID="lbldcfomate" runat="server" Text='<%#Eval("TFOID") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Supplier">
                                        <ItemTemplate>
                                            <asp:Label ID="lblsupplier" runat="server" Text='<%#Eval("VendCust_Lid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Tax Group">
                                        <ItemTemplate>
                                            <asp:Label ID="lbltaxgroup" runat="server" Text='<%#Eval("DcTax_SubClassid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Date">
                                        <ItemTemplate>
                                            <asp:Label ID="lbldate" runat="server" Text='<%#Eval("TrnDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Details">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hypdetails" runat="server" NavigateUrl="#" Text="Details"></asp:HyperLink>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Edit">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hypEdit" runat="server" NavigateUrl="#" Text="<img src='../../Menu/images/Edit_user.png'/>"></asp:HyperLink>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                </Columns>
                                  <PagerStyle HorizontalAlign="Right" /> 
                  <HeaderStyle HorizontalAlign="Center" />     
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </div>
       </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
